//
//  LXApp+IDFA.swift
//  LXApp
//
//  Created by yoctech on 2021/8/18.
//

import Foundation
import AppTrackingTransparency
import AdSupport

public extension LXApp {
    static var IDFA: String {
        if #available(iOS 14.0, *) {
            switch ATTrackingManager.trackingAuthorizationStatus {
            case .authorized:
                return ASIdentifierManager.shared().advertisingIdentifier.uuidString
            default:
                return "00000000-0000-0000-0000-000000000000"
            }
        }
        return ASIdentifierManager.shared().advertisingIdentifier.uuidString
    }
}
